//package com.zr.web.controller.system;
//
//import com.alibaba.fastjson2.JSONObject;
//import com.zr.common.core.controller.BaseController;
//import com.zr.common.core.domain.AjaxResult;
//import com.zr.system.domain.vo.Region;
//import com.zr.system.service.IRegionService;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiImplicitParam;
//import io.swagger.annotations.ApiImplicitParams;
//import io.swagger.annotations.ApiOperation;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.*;
//
//import java.util.List;
//
//@Api("行政区划")
//@RestController
//@RequestMapping("/region")
//public class RegionController extends BaseController {
//
//    @Autowired
//    private IRegionService regionService;
//
//    @PostMapping("/save")
//    @ApiOperation("保存对象")
//    public AjaxResult add(@RequestBody Region info) {
//        return toAjax(regionService.addRegion(info));
//    }
//
//    @PutMapping("/edit")
//    @ApiOperation("修改对象")
//    public AjaxResult edit(@RequestBody Region info) {
//        return toAjax(regionService.updateRegion(info));
//    }
//
//    @DeleteMapping("/delete/{id}")
//    @ApiOperation("删除对象")
//    public AjaxResult delete(@PathVariable("code") Long code) {
//        return toAjax(regionService.deleteRegionById(code));
//    }
//
//    @GetMapping("/info/{id}")
//    @ApiOperation("查看对象信息")
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "id", value = "主键", required = true)
//    })
//    public AjaxResult info(@PathVariable("code") Long code) {
//        Region info = regionService.getRegionById(code);
//        return AjaxResult.success(info);
//    }
//
//    @GetMapping("/list")
//    @ApiOperation("查看列表")
//    public AjaxResult list() {
//        List<Region> list = regionService.getAllRegions();
//        return AjaxResult.success(this.getDataTable(list));
//    }
//
//    @GetMapping("/getRegionsFromGov")
//    @ApiOperation("爬取行政区划")
//    public AjaxResult getRegionsFromGov() {
//        JSONObject json = regionService.getRegionsFromGov();
//        return AjaxResult.success(json);
//    }
//
//}
